
<?php
if (!defined('W_ROOT')) {
	exit();
}

?>
<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         ::<a href="index.php?view=list"><?php echo $lang['BAN_MANAG']; ?></a>
         ::<?php echo $lang['EDIT']; ?>
      </div>
<div class="box">
<?php
	if(!empty($_GET['error'])){
		echo '<div class="warning">Your file you provided is invalid!</div>';
	}
	if(!empty($_GET['errors'])){
		echo '<div class="warning">Invalid Link URl format!</div>';
	}
?>
<div class="heading">
	<h1><img src="../templates/image/banner.png" alt="" />
			<?php echo $lang['BAN_MANAG']; ?>
	</h1>
	<div class="buttons">
	<form action="process.php?action=edit"  method="post" name="frmlist"  enctype="multipart/form-data">
		  <input class="button" type="submit" name="btnsave" value="Save"/>&nbsp;&nbsp;&nbsp;
            <input class="button" type="reset" name="btnreset" value="Reset" />&nbsp;&nbsp;&nbsp;
            <input class="button" type="button" name="btncancel" value="Cancel" onClick="javascript:window.history.back();" />
	</div>
	</div>
	<div class="content">
<div class="row">
 <?php
    if(isset($_GET['id'])){
		 $ids=(int)$_GET['id'];
		 $_SESSION['id_for']=$ids;
		}
    $selet_edit_banner="SELECT *FROM tbl_banner WHERE ban_id=$ids";
	$query=mysql_query($selet_edit_banner);
	if(mysql_num_rows($query)>0){
		  while($rows=mysql_fetch_assoc($query)){
			   $banner_title=$rows['ban_title'];
			   $banner_link=$rows['ban_addlink'];
			   $banner_description=$rows['ban_description'];
			   $image=$rows['ban_img_upload'];
 ?>

<table cellpadding="5" cellspacing="5" border="0" width="100%" align="center">
<tr>
<td colspan="3" align="left"><strong style="color:#F00;">* are requirement</strong></td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top">Banner Title <strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txttitle" type="text"  alt="required" id="txttitle"  value="<?php echo $banner_title;?>" required  />
   </td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top">Upload Image <strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txtimage" type="file" />&nbsp;&nbsp;<span style="color:#096;"><?php echo $image;?></span>
		<img src="../../images/banners/<?php echo $image ; ?>" width="90px" alt="right"/>
   </td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top">AddLink Image <strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txtaddlink" type="text"  id="txtmeta_desc"  value="<?php echo $banner_link;?>"  required/> <span style="color:red;">Note: (https://www.google.com)</span>
   </td>
</tr>
<input type="hidden" name="hid" value="<?php echo @$ids;?>"/>
<tr>
   <td width="10%" height="30" align="left" valign="top">Description</td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">


        <textarea name="txtdescription" style="width:50%;height:100px;"><?php echo $banner_description;?></textarea>

   </td>
</tr>

<tr>
<td>&nbsp;</td>
</tr>
</table>
<?php }
} ?>
</form>
</div>
</div>
</div><!--<div class="row">-->
<script type="text/javascript" src="<?php echo base_url; ?>admin/templates/javascript/ckeditor/ckeditor.js"></script>
<script>
    $(document).ready(function() {
        CKEDITOR.replace('txtdesc', { });
    });
    $('#tabs a').tabs();
</script>
